﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditTemplate.aspx.cs" Inherits="EditTemplate" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        * { margin: 0; padding: 0; }
        input { padding: 4px; }
        body { background: url(images/edittopbg.jpg) repeat-x scroll 0 0 #F7FAE6; }
        .editor-bottom { border-top: 8px solid #80B31A; text-align: center; }
        .editor-bottom-btn { background: url(images/edithidebtn.gif) no-repeat scroll 0 0 transparent; cursor: pointer; height: 15px; margin: 0 auto; width: 56px; }
        .editor-bottom-btnshow { background: url(images/editshowbtn.gif) no-repeat scroll 0 0 transparent; cursor: pointer; height: 15px; margin: 0 auto; width: 56px; }
        .css-editor { margin: 5px; }
        #t-right { float: right; height: 33px; padding-right: 10px; text-align: right; }
        #t-right #b_ok { background: url(images/btn.gif) no-repeat scroll 0 0 transparent; border: 0 none; height: 25px; margin-right: 5px; width: 69px; }
        #t-right #b_cancel { background: url(images/btn.gif) no-repeat scroll -69px 0 transparent; border: 0 none; height: 25px; margin-right: 0; width: 69px; }
        #t-right input { cursor: pointer; margin: 4px 5px 0 0; padding: 0; }
        
        .clear { clear: both; }                
        #btnview { background: url(images/btn.gif) no-repeat scroll -207px 0 transparent; border: 0 none; cursor: pointer; height: 21px; padding: 4px 0 0; width: 47px; }
    </style>

    <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="js/Color.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function()
        {

            $("#btnview").click(function()//预览效果
            {
                $.setcss($("#txtBgColor"));
            });
            var cbcallback = null;
            // $("#showpage").css("height",document.body.clie);
            $("#txtBgColor").click(function()
            {
                rcolor(this, true);
            });
          
            jQuery.setcss = function(obj)
            {
                $("#showpage").contents().find("body").css("background-color", $(obj).val());
            }

            $("#editBottomBtn").click(function()
            {
                if ($("#cssEditorBox").is(":hidden"))
                {
                    $("#cssEditorBox").show();
                    $(this).attr("class", "editor-bottom-btn");
                }
                else
                {
                    $("#cssEditorBox").hide();
                    $(this).attr("class", "editor-bottom-btnshow");
                }
            });

            $("#b_ok").click(function()
            {
                $.post("/ashx/editmb.ashx?ac=savecommcss", { act: 'fd',body:"background" }, function(res)
                {
                    alert(res);
                    location.href = "/";
                });

            });

            $("#b_cancel").click(function()
            {
                location.href = "/";
            });

        });
       
    </script>

</head>
<body>
    <div id="cssEditorBox" class="css-editor">
        <div style="float: left; font-size: 14px; padding: 35px 10px 0px 10px;">
            <table>
                <tr>
                    <td>
                        背景色：
                    </td>
                    <td>
                        <input type="text" value="#000000" id="txtBgColor" title="点击选取颜色" style="background-color: #000000; width: 80px; color: white;" />
                    </td>
                </tr>
                <tr>
                    <td>
                        文字链接：
                    </td>
                    <td>
                        <input type="text" value="#000000" id="Text1" onclick="rcolor(this,true)" title="点击选取颜色" style="background-color: #000000; width: 80px; color: white;" />
                    </td>
                </tr>
                <tr>
                    <td>
                        背景图片：
                    </td>
                    <td>
                        <input type="text" value="#000000" id="Text2" onclick="rcolor(this,true)" title="点击选取颜色" style="background-color: #000000; width: 80px; color: white;" />
                    </td>
                </tr>
                <tr>
                    <td>
                        背景图片：
                    </td>
                    <td>
                        <input type="text" value="#000000" id="Text3" onclick="rcolor(this,true)" title="点击选取颜色" style="background-color: #000000; width: 80px; color: white;" /><input id="btnview" type="button" value="" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="t-right">
            <input type="button" style="cursor: auto; display: none; background-position: -350px 0pt;" autocomplete="off" disabled="" id="b_chexiao" title="" />
            <input type="button" autocomplete="off" title="保存" id="b_ok" /><input type="button" autocomplete="off" title="取消" id="b_cancel" />
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="editor-bottom">
        <div id="editBottomBtn" class="editor-bottom-btn">
        </div>
    </div>
    <iframe src="/" id="showpage" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" width="100%" height="600px"></iframe>    
</body>
</html>
